import request from "./index";

/** 图形验证码 */
export async function getCaptcha() {
  return request<ArrayBuffer>(
    "/user/getCaptcha",
    {},
    "GET",
    { responseType: "arraybuffer" },
    true
  );
}

/** 登录 */
export async function userLogin(data: any, options: any = {}) {
  return request<API.LoginRes>("/user/login", data, "POST", options);
}

/** 获取手机验证码 */
export async function getMobileCode(data: any) {
  return request<string>("/user/getMobileCode", data);
}

/** 用户注册*/
export async function userRegister(data: any) {
  return request<string>("/user/register", data, "POST");
}

/** 重置密码*/
export async function userResetPwd(data: any) {
  return request<string>("/user/resetPwd", data, "POST");
}
